(switch-to-buffer-other-frame): Return the buffer
authorAndreas Schwab <schwab@suse.de>
Sun, 23 Dec 2007 16:08:30 +0000 (16:08 +0000)
committerAndreas Schwab <schwab@suse.de>
Sun, 23 Dec 2007 16:08:30 +0000 (16:08 +0000)
switched to.

lisp/files.el

index 423bc1eb8047fbcd7deb097d2fee8615f6c66fa5..d4b15324f94eef4c471b3a309f5ab7ebdc3976c8 100644 (file)
@@ -1010,14 +1010,16 @@ documentation for additional customization information."
   "Switch to buffer BUFFER in another frame.
 Optional second arg NORECORD non-nil means
 do not put this buffer at the front of the list of recently selected ones.
+This function returns the buffer it switched to.
 
 This uses the function `display-buffer' as a subroutine; see its
 documentation for additional customization information."
   (interactive "BSwitch to buffer in other frame: ")
   (let ((pop-up-frames t)
        same-window-buffer-names same-window-regexps)
-    (pop-to-buffer buffer t norecord)
-    (raise-frame (window-frame (selected-window)))))
+    (prog1
+       (pop-to-buffer buffer t norecord)
+      (raise-frame (window-frame (selected-window))))))
 
 (defun display-buffer-other-frame (buffer)
   "Switch to buffer BUFFER in another frame.